<!--<!DOCTYPE html>-->
<!--<html lang="en" xmlns:th="http://www.thymeleaf.org">-->
<!--<head>-->
<!--    <meta charset="UTF-8">-->
<!--    <title>Title</title>-->
<!--</head>-->
<!--<body>-->
<!--<H1>列表页面</H1>-->
<!--<table>-->
<!--    <tr><th>name</th><th>password</th><th>操作</th></tr>-->
<!--    <tr th:each="p:${personList}">-->
<!--        <td th:text="${p.name}"></td>-->
<!--        <td th:text="${p.password}"></td>-->
<!--        <td><a href="#" th:href="@{delete(name=${p.name})}">删除</a >-->
<!--            <a href="#" th:href="@{/toUpdate(name=${p.name})}">去修改</a ></td>-->

<!--    </tr>-->
<!--</table>-->
<!--<a th:href="@{/toAdd}">添加新的Person</a>-->
<!--</body>-->
<!--</html>-->

<!DOCTYPE html>
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>人员列表 - 人员管理系统</title>
    <link rel="stylesheet" href="/css/common.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body class="list-page">
<div class="page-container">
    <header>
        <a href="/" class="back-btn">
            <i class="fas fa-arrow-left"></i>
        </a>
        <h1>人员列表</h1>
    </header>

    <a href="/toAdd" class="add-btn">
        <i class="fas fa-user-plus"></i> 添加人员
    </a>

    <div th:if="${personList.isEmpty()}" class="empty-state">
        <i class="fas fa-folder-open"></i>
        <p>暂无人员数据</p>
        <a href="/toAdd">点击添加人员</a>
    </div>

    <div class="list-container" th:if="${!personList.isEmpty()}">
        <div class="list-item" th:each="p : ${personList}">
            <div class="list-info">
                <div class="list-name" th:text="${p.name}"></div>
                <div class="list-password" th:text="${p.password}"></div>
            </div>
            <div class="list-actions">
                <a th:href="@{delete(name=${p.name})}" class="action-btn delete-btn" onclick="return confirm('确定要删除吗？')">
                    <i class="fas fa-trash"></i>
                </a>
                <a th:href="@{/toUpdate(name=${p.name})}" class="action-btn edit-btn">
                    <i class="fas fa-edit"></i>
                </a>
            </div>
        </div>
    </div>
</div>
</body>
</html>
